﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DevLib.SuperTool;
using System.Threading;

/** 
 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
 * Description: 
 * Author: Heller (HellerSong@outlook.com)
 * CreationTime: 3/24/2015 9:07:53 PM
 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 
 **/
namespace UnitTest.TestSuperTool
{
	[TestClass]
	public class TestProcessOM
	{
		[TestMethod]
		public void test_launch_exe()
		{
			ProcessOM.Launch("notepad.exe");
			ProcessOM.Launch("iexplore.exe");
			ProcessOM.Launch(ProcessOM.EXE_IE, "www.baidu.com");
		}

		[TestMethod]
		public void test_destroy_whole_exe()
		{
			ProcessOM.Launch(ProcessOM.EXE_NOTEPAD);
			Thread.Sleep(1000);
			ProcessOM.Launch(ProcessOM.EXE_NOTEPAD);
			Thread.Sleep(1000);
			ProcessOM.Launch(ProcessOM.EXE_NOTEPAD);
			Thread.Sleep(2000);
			ProcessOM.Destroy(ProcessOM.EXE_NOTEPAD);
		}

		[TestMethod]
		public void test_close_current_process()
		{
			ProcessOM.Launch(ProcessOM.EXE_NOTEPAD);
			Thread.Sleep(2000);
			ProcessOM.CloseCurrentProcess();
		}

		// My instresting test, dead lock, haha
		[TestMethod]
		public void test_dead_lock()
		{
			ProcessOM.test1();
		}
	}
}
